# Maintainer: Fabian Bornschein <fabiscafe@archlinux.org>

pkgname=glycin
pkgver=0.1.2
pkgrel=1
pkgdesc="Sandboxed and extendable image decoding"
arch=(loong64 x86_64)
url="https://gitlab.gnome.org/sophie-h/glycin"
license=(
  'LGPL2.1'
  'MPL2'
)
depends=(
  cairo
  gdk-pixbuf2
  glib2
  gtk4
  libjxl
  librsvg
  libxml2
  pango
)
makedepends=(
  git
  libheif
  meson
  rust
)
optdepends=(
  'libheif: heif/heic file support'
)
_commit=84885234beca8185ca739bfcca229fb52b339800 # tags/0.1.2^0
source=("git+https://gitlab.gnome.org/sophie-h/glycin.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed -r 's/_/./;s/\.([a-z])/\1/;s/([a-z])\./\1/;s/[^-]*-g/r&/;s/-/+/g'
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir" --no-rebuild
}
